export default url => {
    const merge = (formData) => window.$axios({
        url: `${url}/merge`,
        method: 'post',
        data:formData
    })
    
    const remove = (fileId) => window.$axios({
        url: `${url}/${fileId}`,
        method: 'delete'
    })
    const removeChunks = (fileId,chunks) => window.$axios({
        url: `${url}/${fileId}/${chunks}`,
        method: 'delete'
    })
    
    const getList = (folderId) => window.$axios({
        url: `${url}/${folderId}/list`,
        method: 'get'
    })

    const uploadTemp = (ioc,data) => window.$axios({
        url: `${url}/import/temp/${ioc}`,
        method: 'post',
        data
    })

    const getHtml = (fileId) => window.$axios({
        url: `${url}/html/${fileId}`,
        method: 'get'
    })

    
    return {
        merge,
        remove,
        removeChunks,
        getList,
        uploadTemp,
        getHtml
    }
}